//引入请求函数
import request from "@/utils/request.ts";
import { requestHttp } from "@/utils/request.ts";

//引入类型约束
import type { responseDataType, carouselDataType, productInfoResponseDataType } from "./type.ts";


/**
 * 首页轮播图数据api
 */
export const reqCarouselList = () => {
    return requestHttp<responseDataType<carouselDataType>>({
        url:"/reception/carousel",
        method:"get"
    })
}

/**
 * 获取商品列表数据分页获取 page=? pageSize=?
 */
export const reqProductList = (page, pageSize) => {
    return requestHttp<productInfoResponseDataType>({
        url:"/reception/product",
        method:"get",
        params:{
            page:page,
            pageSize:pageSize
        }
    })
}

/**
 * 获取所有的商品列表数据
 */
export const reqAllProductList = () => {
    return requestHttp<productInfoResponseDataType>({
        url:"/reception/product/all",
        method:"get"
    })
}